<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DocumentType.aspx.cs" Inherits="DocumentType" Async="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <link rel="stylesheet" type="text/css" href="css/StyleSheet.css" />
    <title>Untitled Page</title>
</head>
<body onload="javascript:Page_OnLoad()" style="background-color: Silver" 
    bgcolor="#c0c0c0">
    
    <asp:Literal ID="litScript" runat="server"></asp:Literal>

    <script type="text/javascript">
    
    function SetPage(pageName)
    {
        document.getElementById(document.getElementById("hidCurrentPage").value).style.display="none";
        document.getElementById(document.getElementById("hidCurrentPage").value + "Href").style.color = "navy";
        
        document.getElementById(pageName).style.display="inline";
        document.getElementById(pageName + "Href").style.color = "#660000";
        
        document.getElementById("hidCurrentPage").value = pageName;
                
        /*
        if(currentPage == "uiReferencesPage")
        {
            InitReferences();
        }
        */
    }
    
    function Page_OnLoad()
    {
       SetPage(document.getElementById("hidCurrentPage").value);
       //InitRoutePage();
       //useService();  
    }
    
    function SubmitPage()
    {
        var lErrors = false;
        if(
            !lErrors && 
            confirm("<%#_rm.GetString(ResKeys.DocsWillBeReturnedToDrafts)%>")
          )
        {
            <%=String.Format("{0};", GetPostBackEventReference(uiSaveAndClose))%>
        }
    }
    </script>
    <form id="form1" runat="server">
    <asp:HiddenField ID="hidSessionId" runat="server" />
        <asp:HiddenField ID="hidCurrentPage" runat="server"  Value="uiGeneralPage" />
    <asp:Label ID="uiMessage" runat="server" Text="" Style="color:Red" EnableViewState="false"></asp:Label>
    <br />
        <asp:PlaceHolder ID="uiSaveAndClosePlaceHolder" runat="server"></asp:PlaceHolder>
    
        <input type="button" value="<%#_rm.GetString(ResKeys.CancelButton)%>" onclick="javascript:window.close()" />
        <br />
        
        <span runat="server" id="uiGeneralPageButton"><a id="uiGeneralPageHref" href='javascript:SetPage("uiGeneralPage")'
            style="font-weight: bold; color: navy"><%#_rm.GetString(ResKeys.MainTab) %></a>&nbsp;&nbsp;&nbsp; </span>
        <span runat="server" id="uiRoutePageButton">
            <a id="uiRoutePageHref" href='javascript:SetPage("uiRoutePage")' style="font-weight: bold;
                color: navy"><%#_rm.GetString(ResKeys.RouteTab)%></a>&nbsp;&nbsp;&nbsp;</span>
        <br />
        &nbsp;
        <br />
                
        <div id="uiGeneralPage" style="display:none">
            <table cellspacing="0" cellpadding="0" border="0">
            <tr>
                <td>
                    <%#_rm.GetString(ResKeys.DocTypeName) %>&nbsp;
                </td>
                <td>
                    <asp:TextBox ID="uiDocTypeName" runat="server" Width="457px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td><%#_rm.GetString(ResKeys.Description) %></td>
                <td>
                    <asp:TextBox ID="uiDescription" TextMode="MultiLine" Rows="5" runat="server" Width="457px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td><%#_rm.GetString(ResKeys.Prefix) %></td>
                <td>
                    <asp:TextBox ID="uiPrefix" runat="server"></asp:TextBox>
                    &nbsp;&nbsp;&nbsp;
                    <%#_rm.GetString(ResKeys.NextNumber) %>&nbsp;<asp:TextBox ID="uiNextNumber" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            
            </tr>
            <tr>
                <td colspan="2">
                    <a target="_blank" href='<%#String.Format("PermissionMgmt.aspx?ID={0}&ItemType={1}", _sessionData.DocTypeItem.Id, "DocType") %>'><%#_rm.GetString(ResKeys.DocumentTypePermission) %> </a>
                </td>
            </tr>
            </table>
        </div>        
        <div id="uiRoutePage" style="display:none">
           

            <table cellspacing="0" cellpadding="0" border="0" width="700px">
                <tr>
                    <td style="height: 22px"><%#_rm.GetString(ResKeys.EmployeeList)%>&nbsp;</td>
                    <td colspan="2" style="height: 22px" align="right">
                        <asp:DropDownList ID="uiEmployee" runat="server" Width="640px">
                        </asp:DropDownList>
                    </td>
                </tr>    
                <tr>
                <td colspan='3'>&nbsp;</td>
                </tr>
                <tr>
                    <td><%#_rm.GetString(ResKeys.RoutePointSelect)%>&nbsp;</td>
                    <td>
                        <asp:DropDownList ID="uiRoutePoint" style="width: 45px" runat="server">
                        </asp:DropDownList>
                        &nbsp;&nbsp;
                        <asp:DropDownList ID="uiRouteItemType" runat="server">
                        </asp:DropDownList>
                    </td>
                    <td align="right">
                        &nbsp;<asp:Button ID="uiAddRouteItem" runat="server" Text='<%#_rm.GetString(ResKeys.AddRouteItemButton)%>' OnClick="uiAddRouteItem_Click" />
                    </td>
                </tr>
                <tr>
                <td colspan='3'>&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="3">
                        <asp:Repeater ID="uiRoute" runat="server">
                            <HeaderTemplate>
                                <table width="700px">
                                <tr>
                                <td align="center" colspan="3" style="font-weight: bold; color: white; background-color: #339999; height: 19px;"><%#_rm.GetString(ResKeys.RouteTableTitle)%></td>
                                </tr>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <%#( (int)Eval("RouteItemType") == _notificationRouteItemType )?"[!]":"[>]" %>&nbsp;<font style='font-weight: bold; color: black;'><%#Eval("DisplayName")%></font>
                                    </td>
                                    <td align="left">
                                        &nbsp;<%#_rm.GetString(ResKeys.RoutePointInPanel)%>&nbsp;<font style='font-weight: bold; color: black;'><%#Eval("RoutePointNum")%></font>
                                    </td>
                                    <td align="right">
                                        <asp:CheckBox CssClass="checkBox" 
                                            ID="uiRouteTableRemoveButton" 
                                            runat="server" 
                                            Text='<%#_rm.GetString(ResKeys.Remove) %>' 
                                            OnCheckedChanged="uiRemove_OnCheckedChanged" 
                                            AutoPostBack="true" 
                                            />
                                    </td>
                                
                                </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                        
                        </asp:Repeater>
                        
                        
                    
                      
                    </td>
                </tr>
                <tr>
                    <td colspan="3" style="text-align: justify">
                        <br />
                        <asp:Label ID="uiRouteInstruction" runat="server"><%#_rm.GetString(ResKeys.RouteInstruction) %></asp:Label>
                    </td>
                </tr>
            </table>
            
        </div>
    </form>
    

    
</body>
</html>
